package cn.apthink.calendar;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Holiday {
	private String departmentId;
//	private String holidayName;
	private LocalDate startDate;
	private LocalDate endDate;

	public boolean contain(LocalDate current) {
		return !startDate.isAfter(current) && !endDate.isBefore(current);
	}

	public static Holiday testData() {
		Holiday holiday = new Holiday();
		holiday.setStartDate(LocalDate.parse("2025-01-28"));
		holiday.setEndDate(LocalDate.parse("2025-02-03"));
//		holiday.setHolidayName("2025春节");
		return holiday;
	}
	
	public static List<Holiday> testDatas() {
		List<Holiday> holidays = new ArrayList<Holiday>();
		Holiday holiday = Holiday.testData();
		holidays.add(holiday);
		holiday = new Holiday();
		holiday.setStartDate(LocalDate.parse("2025-01-01"));
		holiday.setEndDate(LocalDate.parse("2025-01-01"));
		holiday.setDepartmentId("floor");
		holidays.add(holiday);

		holiday = new Holiday();
		holiday.setStartDate(LocalDate.parse("2025-01-06"));
		holiday.setEndDate(LocalDate.parse("2025-01-06"));
//		holiday.setHolidayName("line1拓展日");
		holiday.setDepartmentId("l1");
		holidays.add(holiday);

//		holiday = new Holiday();
//		holiday.setStartDate(LocalDate.parse("2025-01-06"));
//		holiday.setEndDate(LocalDate.parse("2025-01-06"));
//		holiday.setHolidayName("line3拓展日");
//		holiday.setDepartmentId("line3");
//		holidays.add(holiday);
		return holidays;
	}
}
